import instance from '@/utils/request.js'

export const getUserList = (params) => {
  return instance({
    url: '/user/list',
    method: 'get',
    params,
  })
}
export const editUser = (data) => {
  return instance({
    url: `/user`,
    method: 'put',
    data,
  })
}

export const deleteUser = (id) => {
  return instance({
    url: `/user/${id}`,
    method: 'delete',
  })
}

export const addUser = (data) => {
  return instance({
    url: '/user',
    method: 'post',
    data,
  })
}

export const getAdminInfo =() => {
  return instance({
    url: 'admin',
    method: 'get',
  })
}

export const editAdminInfo =(data) => {
  return instance({
    url: 'admin',
    method: 'put',
    data
  })
}


export const editAdminPassword = (data) => {
  return instance({
    url: 'admin/updatePwd',
    method: 'put',
    data
  })
}
